import { defineStore } from '@/common/config/defineStore'

export default defineStore('workStore', {
  state: () => ({
    processCenter: []
  }),
  actions: {
    setCenter(val) {
      console.log('val: ', val)
      let list = []
      if (typeof val === 'object') {
        Object.keys(val).forEach((key) => {
          list = [...val[key], ...list]
        })
      } else {
        list = val
      }
      console.log('list: ', list)
      this.processCenter = list
    }
  }
})
